kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumo-pub/tokudb
    REF "v${VERSION}"
    SHA512 0fe5a63c04b62db438d32c516b40f6beea1ffa1ebf6a6144d7065dc46c9555b8cfd2eb645462a50709327cdc8e5e9ec30bd79ab1d1f7da2acc34f5a2843aea90
    HEAD_REF master
)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    OPTIONS
        -DBUILD_UNITTESTS=OFF
        -DENABLE_SANITIZER=OFF
        -DENABLE_UBSAN=OFF
)

kmpkg_cmake_install()

kmpkg_copy_pdbs()
kmpkg_cmake_config_fixup(PACKAGE_NAME tokudb CONFIG_PATH lib/cmake/tokudb)
kmpkg_fixup_pkgconfig()

kmpkg_copy_tools(TOOL_NAMES tokudb AUTO_CLEAN)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
